//
//  Network+TabCategoty.m
//  AFNetworking
//
//  Created by admin on 2020/5/14.
//


@implementation Network (TabCategoty)
/**
 /tabCategory/create
 新增店铺分类管理
 */
-(void)createTabCategory:(NSString*)name shopId:(NSString*)shopId Block:(NetworkEndBlock)endblock{
    NSString *url = [NSString stringWithFormat:@"%@/tabCategory/create",BASEURL];
    NSString *token =  [NSString stringWithFormat:@"Bearer%@",[UserInfo share].token] ;
    [self sendPost:url
             param:@{@"name":name,@"shopId":shopId}
              head:@{
                  @"Authorization":token
              }  block:endblock];
}

/**
 /tabCategory/delete
删除店铺分类管理
 */
-(void)deleteTabCategory:(NSString*)tabid Block:(NetworkEndBlock)endblock{
    NSString *url = [NSString stringWithFormat:@"%@/tabCategory/delete/%@",BASEURL,tabid];
    NSString *token =  [NSString stringWithFormat:@"Bearer%@",[UserInfo share].token] ;
    [self sendPost:url
             param:@{}
              head:@{
                  @"Authorization":token
              }  block:endblock];
}

/**
 /tabCategory/list
 查询店铺分类管理
 */
-(void)listTabCategoryshopId:(NSString*)shopId Block:(NetworkEndBlock)endblock{
    NSString *url = [NSString stringWithFormat:@"%@/tabCategory/list",BASEURL];
    NSString *token =  [NSString stringWithFormat:@"Bearer%@",[UserInfo share].token] ;
    [self sendGet:url
            param:@{@"shopId":shopId}
             head:@{
                 @"Authorization":token
             }  block:endblock];
}

/**
 /tabCategory/create
 新增店铺分类管理
 */
-(void)updateTabCategory:(NSString*)categoryId categoryDic:(NSDictionary *)categorydic  Block:(NetworkEndBlock)endblock{
    NSString *url = [NSString stringWithFormat:@"%@/tabCategory/update/%@",BASEURL,categoryId];
    NSString *token =  [NSString stringWithFormat:@"Bearer%@",[UserInfo share].token] ;
    [self sendPost:url
             param:categorydic
              head:@{
                  @"Authorization":token
              }  block:endblock];
}

/**
 /tabCategory/sorf
店铺分类排序
 */
-(void)sorfTabCategory:(id)tabCategorys Block:(NetworkEndBlock)endblock{
    NSString *url = [NSString stringWithFormat:@"%@/tabCategory/sort",BASEURL];
    NSString *token =  [NSString stringWithFormat:@"Bearer%@",[UserInfo share].token] ;
    [self sendPost:url
             param:tabCategorys
              head:@{
                  @"Authorization":token
              }  block:endblock];
}
@end
